<template>
	<view>
		<txl @ev="evFunc" @ec="ecFunc" :datas="datas" color="red" :index="true" name="employeeName"></txl>
	</view>
</template>

<script>
	import txl from '@/components/txl/index.vue'
	import { getLawyerList } from '@/api/indexApi.js'
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#0d2647',
				},
				datas: []
			}
		},
		onLoad() {
			this._getLawyerList()
		},
		methods: {
			async _getLawyerList() {
				uni.showLoading({title: '请稍后...'})
				const res = await getLawyerList({length: 999})
				// console.log(res)
				let lawyerList = res.data.data.list.filter(item => item.avatar_big)
				lawyerList.forEach(item => {
					let obj = {}
					obj.employeeName = item.nickname
					obj.departmentName = item.job_title
					obj.avatar = item.avatar
					obj.id = item.id
					this.datas.push(obj)
				})
				uni.hideLoading()
			},
			evFunc(data) {
				console.log(data)
			},
			ecFunc(data) {
				console.log(data)
				uni.navigateBack()
			}
		},
		components: {
			txl
		}
	}
</script>

<style lang="scss">
	page {
		background: #f5f5f5;
	}
</style>
